<template>
  <div class="left">
    <span
      @click="tabClick(index)"
      v-for="(item, index) in cityList"
      :key="item.id"
      :class="tabIndex === index ? 'active' : ''"
    >
      {{ item.province }}
      <template v-if="item.selectedArr.length">
        {{ item.selectedArr.length }}
      </template>
    </span>
  </div>
</template>

<script>
/**
 * 除了带有 v-model的组件特殊
 */
export default {
  props: ['cityList', 'tabIndex'],
  methods: {
    tabClick(index) {
      this.$emit('tabClick', index)
    },
  },
}
</script>

<style></style>
